using System.IO;
using Newtonsoft.Json;

namespace touhou_bullet_rain;

/// <summary>
/// 客户端配置信息
/// </summary>
public class ClientProperties {

    public string playerName;
    public string connectIP;
    public int connectPort;
    public int windowWidth;
    public int windowHeight;

    /// <summary>
    /// 读取配置文件
    /// </summary>
    public static ClientProperties ReadProperties() {
        const string propertiesLocation = "./client_properties.json";
        string jsonContent = File.ReadAllText(propertiesLocation);
        return JsonConvert.DeserializeObject<ClientProperties>(jsonContent);
    }

}